﻿using System;

using Dxr.Police.Models;

using Zongsoft.Common;

namespace Dxr.Police.Web.Models
{
    public class UserInfoDisplayModel : UserInfo
    {
        public string RoleText
        { get { return Role.GetEnumEntry().Description; } }

        public string DeletedText
        { get { return Deleted ? "是" : "否"; } }

        public string IsLeaderText
        { get { return IsLeader ? "是" : "否"; } }

        public string LiableText
        { get { return Liable ? "是" : "否"; } }
    }

    public static partial class DispalyModel
    {
        public static UserInfoDisplayModel ToDisplayModel(this UserInfo model)
        {
            return AutoMapper.Mapper.Map<UserInfo, UserInfoDisplayModel>(model);
        }
    }
}
